package com.ming.Servlet;

import com.ming.DaoImp.equipmentDaoImp;

import javax.servlet.ServletException;
import javax.servlet.annotation.WebServlet;
import javax.servlet.http.HttpServlet;
import javax.servlet.http.HttpServletRequest;
import javax.servlet.http.HttpServletResponse;
import java.io.IOException;
import java.util.List;
import com.ming.Dao.*;
import com.ming.entity.*;


/**
 * Created by Administrator on 2018/7/30 0030.
 */
@WebServlet(name = "findServlet")
public class findServlet extends HttpServlet {
    protected void doPost(HttpServletRequest request, HttpServletResponse response) throws ServletException, IOException {
       // response.setContentType("text/html;charset=utf-8");
       // PrintWriter out = response.getWriter();
        request.setCharacterEncoding("utf-8");
        equipmentDao eq = new equipmentDaoImp();
        List<equipment> list = eq.findEquipment();
        request.setAttribute("list",list);
        //String json = JSON.toJSONString(list);
        request.getRequestDispatcher("admin-cate.jsp").forward(request,response);
        //out.print(json);

        // out.flush();
        //out.close();
    }


    protected void doGet(HttpServletRequest request, HttpServletResponse response) throws ServletException, IOException {
    doPost(request,response);
    }
}
